import request from '@/utils/http'

const PATH = '/activity'

export const getDepositBonus = (params?: any) =>
	request({ url: `${PATH}/depositBonus/detail`, method: 'get', params })

export const resRfcsHome = (params: any) => request({ url: `${PATH}/rfcs`, method: 'get', params })

// /activity/bonus/reload-state
export const getFirstBonus = () => request({ url: `${PATH}/bonus/first-state`, method: 'get' })

// /activity/bonus/participate-first
export const getParticipateStatus = () =>
	request({ url: `${PATH}/bonus/participate-first`, method: 'get' })

export const getReloadBonus = () => request({ url: `${PATH}/bonus/reload-state`, method: 'get' })

/**
 *"state": "close" | "open"
 * */
export const updateFirstBonus = (data: any) =>
	request({ url: `${PATH}/bonus/first-state`, method: 'put', data })

/**
 *"state": "close" | "open"
 * */
export const updateReloadBonus = (data: any) =>
	request({ url: `${PATH}/bonus/reload-state`, method: 'put', data })

export const getVipList = () => request({ url: `${PATH}/vip/list`, method: 'get' })

export const getStarList = () => request({ url: `${PATH}/star/list`, method: 'get' })

export const vipUpgradeList = () => request({ url: `${PATH}/vip-upgrade/bonus`, method: 'get' })

export const getBonusActivities = (params: any) =>
	request({ url: `${PATH}/bonus/activities`, method: 'GET', params })

export const getRewardsConfig = (params: any) =>
	request({ url: `${PATH}/rewards-config`, method: 'GET', params })

export const getBonusList = (data: any) =>
	request({ url: `${PATH}/bonus/list`, method: 'post', data })

export const getDateSelector = (bonusType: any) =>
	request({
		url: `${PATH}/bonus/selector?bonusType=${bonusType}`,
		method: 'get'
	})
export const getProgressive = () =>
	request({ url: `${PATH}/bonus/progressive-detial`, method: 'GET' })

export const resUserUpgradeInfo = () => request({ url: `${PATH}/upgrade/info`, method: 'get' })

export const getBonusStat = (data: any) =>
	request({ url: `${PATH}/bonus/stat`, method: 'post', data })

export const receiveBonus = (data: any) =>
	request({ url: `${PATH}/bonus/receive`, method: 'post', data })

export const deleteNotifications = (params: any) =>
	request({ url: `${PATH}/notifications`, method: 'DELETE', params })

export const getNotifications = () => request({ url: `${PATH}/notifications`, method: 'GET' })

export const getUpgradeRule = (params: any) =>
	request({ url: `${PATH}/upgrade-rule`, method: 'GET', params })
export const getUpgradeReward = () => request({ url: `${PATH}/vipBonus/detail`, method: 'GET' })
export const getRewardPage = (data: {
	//groupManageName: string
	groupManageId: string
	//groupStatus: number
}) => request({ url: `${PATH}/vipBonus/getRewardPage`, method: 'POST', data })
export const putRedeem = (data: {
	id: number
	userId: number
	// operator: string
	currency: string
	// createdBy: number
	// updatedBy: number
	// createdAt: string
}) => request({ url: `${PATH}/vipBonus/redeem`, method: 'PUT', data })

export const getVipBonusStatus = () => request({ url: `${PATH}/vipBonus/status`, method: 'GET' })
